#include"process.h"
#include<unistd.h>
#include<string.h>
#define MAX 100
#define state '#'
#define times 1000*20

char bar[]={'\\','-','/'};

void function()
{
  char ret[101]={0};
  int rate=0;
  int size=strlen(bar);
  while(rate<=MAX)
  {
    printf("[%-100s][%d%%][%c]\r",ret,rate,bar[rate%size]);
    fflush(stdout);
    usleep(times);   //以毫秒进行
    ret[rate++]=state;
  }
  printf("\n");
}
